package ru.usu.gv.gui.actions;

import ru.usu.gv.core.GraphCanvas;
import ru.usu.gv.uicomponents.UIGraph;
import ru.usu.gv.uicomponents.UIVertex;

import javax.vecmath.Point3d;

/**
 @author Sergey Pupyrev 
 08.01.2007
 */

public class AddVertexAction extends ActionBase
{
	private Point3d position;

	public AddVertexAction(Point3d position)
	{
		super();
		this.position = position;
	}

	@Override
	public void execute()
	{
		UIGraph currentGraph = GraphCanvas.getInstance().getCurrentGraph();
		UIVertex vertex = new UIVertex(position);
		currentGraph.addVertex(vertex);
		vertex.draw();
	}
}
